
import getFetch from "../service/fetch";
//加入购物车,商品id，数量，规格id，价格；
const addShopCart=(goodsId, num, skuId, price,package_id,activity_id)=> {
  return new Promise((resolve, reject) => {
    getFetch('/api/shop.car/AddCar', {
      platform_goods_id: goodsId,//商品id；
      num: num,//数量；
      platform_goods_specs_id: skuId?skuId:"",//规格id；
      actual_money: price?price:"",//单价
      package_id: package_id?package_id:'',//套餐id
      activity_id: activity_id?activity_id:'',//活动id
    }).then(res => {
        resolve(res)
      },
      (err) => {
        reject(err)
      }
    )
  });
};
// //查询购物车数量；
const getCarNum=()=>{
return new Promise((resolve, reject) => {
  getFetch('/api/shop.car/getCarNum').then(res => {
      resolve(res)
    },
    (err) => {
      reject(err)
    }
  )
});
};
export {addShopCart,getCarNum}
